<? /* ÖzgürSözlük Projesi
      Entry gösterme modülü
*/

$entryid = $_GET["entry"];
if ($entryid == "") {$entryid = "14";}

$entry = mysql_fetch_row(mysql_query("SELECT * FROM entry WHERE id='$entryid';"));

$baslik = mysql_query("SELECT * FROM baslik WHERE id='$entry[1]';");
$baslik = mysql_result($baslik, 0, "baslik");

$iBaslik = baslikIsle2($baslik);
echo "<b> Entry: #$entryid (<a href=\"index.php?baslik=$iBaslik\">$baslik</a>) </b>";

echo "<div id=\"entry\" onMouseOver=\"this.style.backgroundColor='#333333';\" onMouseOut=\"this.style.backgroundColor='';\">\n";
echo "\t<table>\n";
echo "\t\t<tr><td>".str_replace("\n", "<br />", entryIsle($entry[3]))."</td></tr>\n";
echo "\t\t<tr><td><a href=index.php?yazar=$entry[2]><img src=\"templates/default/images/icon_user.gif\" /></a> <a href=\"index.php?baslik=".$entry[2]."\">".$entry[2]."</a></td>";
echo "<td><a href=\"index.php?entry=$entry[0]\"> #$entry[0]</a></td>";
echo "<td>".entryDuzenle($girisMi, $entry[2], $entry[0])."</td>";
echo "<td>".$entry[5]." ~ $entry[9]</td></tr>\n\t</table>\n";
echo "</div><br />";
echo "<a href=index.php?baslik=$iBaslik> Başlığın geri kalanı </a>";

if ($_GET["duzenle"] == "evet") { ?>
<form action="index.php?entry=<?echo "$entryid";?>&duzenle=bitti" method=post>
    <textarea cols=60 rows=10 name="entry" style="background: black;border: 1px solid gray;color: gray;"><?echo "$entry[3]"?></textarea><br>
    <input type=submit value="Yaz aslanım!">
    <input type=hidden name=eylem value=entrygir>
</form>

<?
} if ($_GET["duzenle"] == "bitti") {
    $tarih = date("j.n.Y H:i");
    $entry = $_POST["entry"];
    mysql_query("UPDATE entry SET entry='$entry', gtarih='$tarih' WHERE id='$entryid';");
    echo "<b> Entry düzenlendi. </b>";
    }
?>